public class Point2D{

    private double x;
    private double y; 

    public Point2D(){
	this(0,0);
    }

    public Point2D(double posX, double posY){

	x = posX;
	y = posY;
    }

    public double getX(){

	return this.x;
    }

    public double getY(){

	return this.y;
    }

    public void setX(double newX){
	this.x = newX;
    }

    public void setY(double newY){
	this.y = newY;
    }

    public void setXY(double newX, double newY){
	setX(newX);
	setY(newY);
    }

    public void translater(double vx, double vy){
	this.x += vx;
	this.y += vy;	
    }

    public Point2D dupliquer()
    {
	return new Point2D(x,y);
    }

    public boolean equals(Point2D p){
	return 
	    this.x == p.x 
	    &&
	    this.y == p.y;
    }

    public double ManathanDistance(Point2D p){
	return Math.abs(p.x-this.x) +Math.abs(p.y-this.y);
    }

    public double distance(Point2D p){
	return Math.sqrt((p.x-this.x)*(p.x-this.x) +(p.y-this.y)*(p.y-this.y));
    }

    public double distanceX(Point2D p){
	return Math.abs(p.x-this.x);
    }
 
    public double distanceY(Point2D p){
	return Math.abs(p.y-this.y);
    }

    public String toString(){
	return "("+x+", "+y+")";
    }

    /*public static void main(String []argv){
	Point2D p = new Point2D(3,4);
	System.out.println(p);
	p.translater(2,2);
	System.out.println(p);
	
	Point2D p2 = new Point2D();

	double Mdistance = p.ManathanDistance(p2);
	System.out.println("ManathanDistance entre "+p+" et "+p2+" = "+Mdistance);

	double distance = p.distance(p2);
	System.out.println("Distance entre "+p+" et "+p2+" = "+distance);
	}*/

}
	